Answer:

Espresso might have worked better.

Car Insurance Example

Here is another example problem that calls for nested IFs:

An insurance company wants a program to calculate the annual premium for car insurance.

Our program will ask the user to enter the base rate from the keyboard. (A practical program would have this information in a file on the hard disk.)

The program will start out asking the user for data: the BASERATE and the annual mileage. Then the program will look the the mileage to figure out the DISCOUNT. The DISCOUNT will be 0.0, 0.05, or 0.10 depending on the mileage. The program will look like this:

PRINT "Please enter the base rate"
INPUT BASERATE

PRINT "Please enter annual mileage"
INPUT MILEAGE

Figure out the DISCOUNT

PRINT "Your base rate is", BASERATE
PRINT "Your discount is", DISCOUNT
PRINT "You pay", BASERATE * (1 - DISCOUNT)

END

QUESTION 13:

The DISCOUNT will be one of three values. What control structure will be used?